package cn.suhaoblog.faq.controller;


import cn.suhaoblog.core.base.BaseController;
import cn.suhaoblog.core.door.CommonResponse;
import cn.suhaoblog.faq.entity.InterviewFaq;
import cn.suhaoblog.faq.service.InterviewFaqService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author su-hao
 * @since 2024-03-20
 */
@RestController
@RequestMapping("/faq/test")
@Api(tags = "这是测试")
public class AnotherTestController extends BaseController {

    @Resource
    private InterviewFaqService faqService;

    @GetMapping("selectAll")
    @ApiOperation(value = "查询FAQ列表", notes = "注意不需要分页参数")
    @ApiResponse(code = 200, message = "查询成功", response = CommonResponse.class)
    public CommonResponse<List<InterviewFaq>> queryAll() {
        return new CommonResponse<List<InterviewFaq>>()
                .msg("查询成功")
                .data(faqService.list(null))
                .ok();
    }

    @GetMapping("selectTest")
    @ApiOperation(value = "查询全部")
    public CommonResponse<String> query() {
        return new CommonResponse<String>()
                .msg("查询成功")
                .data("查询测试")
                .ok();
    }
}
